How can I write byte[] to socket outputstream and specify the end of file?
Posted
by
Christopher Francisco
on Programmers
See other posts from Programmers
or by Christopher Francisco
Published on 2014-06-10T16:16:59Z
Indexed on
2014/06/10
21:46 UTC
Read the original article
Hit count: 278
java
|client-server
I've googled 2 days straight and I can't find how to do this. I have an open stream between client and server, and client will send a JSON string (encrypted to bytes) to the server each 3 to 5 seconds.
How can I write to the Socket
OutputStream
so that I can read each JSON string in the server. I'm guessing I need to specify some kind of end of file or something, but can't find any info on how to achieve this.
© Programmers or respective owner